<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>快開彩期中心 (List) </title>
<link rel="stylesheet" href="../../css/mem_main.css" type="text/css">
<script language="JavaScript" src="/inc/admin_envirset.js"></script>
<script language="JavaScript1.2" type="text/javascript" src="/inc/ajax_begin.js?time=01"></script>
<script language="JavaScript">
<!--
strRowClassName = "clef";
var RSeconds = 0;
var AutoRefreshID;

function getWebGameData(){
	var strDocLoc = "index.php?op=Redirect";

	createXMLHttpRequest();
	xmlHttp.onreadystatechange = handleWebGameDataChange;
	xmlHttp.open("GET", strDocLoc, true);
	xmlHttp.send(null);
	stopAutoRefresh();
}

function handleWebGameDataChange(){
	if(xmlHttp.readyState == 4){
		if(xmlHttp.status == 200){
			var xmlDoc = xmlHttp.responseText;
			
			if(xmlDoc.indexOf("Error") != -1){
				alert(xmlDoc);
				return;
			}

			showWebGameData(eval(xmlDoc));
			ChangeRefreshSec();
			return;
		}
	}
}

function showWebGameData(arrCon){
	var intLID = 0, strID = "", strTmp = "";
	for(intLID = 5; intLID <= 8; intLID++){
		setWebGameDataToTable(intLID, arrCon[intLID - 5]);
	}
}

function setWebGameDataToTable(intLID, arrCon){
	var objWTable = document.getElementById(("LID" + intLID.toString() + "Cont"));
	var objCon = null;

	with(objWTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);

		for (var i = 0; i < arrCon.length; i++) {
			objCon = arrCon[i];

			newTR = insertRow();
			newTR.className = "clef";
			with(newTR){
				var intCellNo = 0;

				newTD = insertCell(intCellNo);
				//newTD.align = "left";
				newTD.innerHTML = '<input type="checkbox" name="WebGID' + intLID + '" value="' + objCon.WebID + ':' + objCon.GID + '" checked>&nbsp;' + objCon.Web;
				intCellNo++;

				newTD = insertCell(intCellNo);
				newTD.innerHTML = objCon.SNo;
				intCellNo++;

				newTD = insertCell(intCellNo);
				newTD.innerHTML = objCon.OSNo;
				intCellNo++;

				newTD = insertCell(intCellNo);
				newTD.innerHTML = objCon.DTime;
				intCellNo++;

				newTD = insertCell(intCellNo);
				newTD.innerHTML = objCon.ETime;
				intCellNo++;

				newTD = insertCell(intCellNo);
				newTD.innerHTML = objCon.Status;
				intCellNo++;

				newTD = insertCell(intCellNo);
				newTD.innerHTML = objCon.BTOff;
				intCellNo++;

				newTD = insertCell(intCellNo);
				newTD.innerHTML = '<a href="JavaScript:OpenClose(0, ' + objCon.WebID + ', ' + intLID + ', ' + objCon.GID + ')">總開放</a> / <a href="JavaScript:OpenClose(1, ' + objCon.WebID + ', ' + intLID + ', ' + objCon.GID + ')">總關閉</a>&nbsp;&nbsp;&nbsp;&nbsp; / <a href="JavaScript:AutoAdd(' + objCon.WebID + ', ' + intLID + ')">新增期數</a>';
				intCellNo++;
			}
		}
	}
}

//重整方式
function RefreshType(){
	if(PageConfig.isEmergency == 1)alert(strOnEmergency);
	with(document.getDataForm){
		if(op.value == "StartGame"){
			StartGame();
		}else{
			GetOdds();
		}
	}
}

//定時重整
function RClock(i){
	if (RSeconds == 0){
		getWebGameData();
		RSeconds = i;
	}
	RSeconds --;
	if(document.getElementById("RSec"))document.getElementById("RSec").innerHTML = RSeconds;
}

//選擇定時時間
function ChangeRefreshSec(){
	stopAutoRefresh();
	AutoRefreshID = setInterval("RClock(15)",1000);
}

//停止自動更新
function stopAutoRefresh(){
	if(AutoRefreshID > 0)clearInterval(AutoRefreshID);
}

function OpenClose(isOff, intWID, intLID, intGID){
	with(document.getDataForm){
		op.value = "OpenOff";
		LottoID.value = intLID;
		isStopBet.value = isOff;
		WebGID.value = intWID + ":" + intGID;
		submit();
	}
}

function AutoAdd(intWID, intLID){
	with(document.getDataForm){
		op.value = "AutoAdd";
		LottoID.value = intLID;
		WebGID.value = intWID;
		submit();
	}
}

function AllAutoAdd(intLID){
	with(document.getDataForm){
		op.value = "AutoAdd";
		LottoID.value = intLID;
		WebGID.value = "0,1,2";
		submit();
	}
}

function AllOpenClose(isOff, intLID){
	var objTemp = document.getElementsByName("WebGID" + intLID);
	var arrWG = [];
	for(var i = 0; i < objTemp.length; i++){
		if(objTemp[i].checked == true)arrWG[arrWG.length] = objTemp[i].value;
	}

	with(document.getDataForm){
		op.value = "OpenOff";
		LottoID.value = intLID;
		isStopBet.value = isOff;
		WebGID.value = arrWG.join(",");
		submit();
	}
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="getWebGameData();ChangeRefreshSec()">
<table width="770" border="0" cellspacing="0" cellpadding="0" class="cmti">
  <tr> 
    <td>快開彩期中心: <b id="RSec" style="color: #FF0000">15</b> sec&nbsp;&nbsp;&nbsp;<input type="button" value="重整" onclick="location.reload()">
	&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php?op=ListResult">開獎結算管理</a>
	</td>
  </tr>
</table>

<div>重慶時時彩</div>
<div class="ctabdv">
  <table width="1000" border="0" cellspacing="1" cellpadding="0" class="ctab" id="LID7Cont">
    <tr class="ctiga"> 
      <td width="100">網站</td>
      <td width="80">一般期數</td>
      <td width="80">官方期數</td>
	  <td width="120">日期時間</td>
	  <td width="80">停押時間</td>
      <td width="80">狀態</td>
	  <td width="200">遊戲開關數</td>
      <td>開關</td>
    </tr>
<!-- 
    <tr class="clef"> 
      <td>{ShowWeb}</td>
      <td>{ShowSerailNo}</td>
      <td>{ShowOSerailNo}</td>
	  <td>{ShowDateTime}</td>
	  <td>{ShowEndTime}</td>
      <td align="center">{ShowStatus}</td>
	  <td align="center">{ShowBTOff}</td>
      <td><a href="JavaScript:OpenClose(0)">總開放</a> / <a href="JavaScript:OpenClose(1)">總關閉</a></td>
    </tr>
 //-->
  </table>
</div>
 <input type="button" value="快速新增" onclick="AllAutoAdd(7)">&nbsp;&nbsp;
<input type="button" value="全部開放" onclick="AllOpenClose(0, 7)">&nbsp;&nbsp;
<input type="button" value="全部關閉" onclick="AllOpenClose(1, 7)">&nbsp;&nbsp;
<br />
<hr /><br />

<div>黑龍江時時彩</div>
<div class="ctabdv">
  <table width="1000" border="0" cellspacing="1" cellpadding="0" class="ctab" id="LID8Cont">
    <tr class="ctiga"> 
      <td width="100">網站</td>
      <td width="80">一般期數</td>
      <td width="80">官方期數</td>
	  <td width="120">日期時間</td>
	  <td width="80">停押時間</td>
      <td width="80">狀態</td>
	  <td width="200">遊戲開關數</td>
      <td>開關</td>
    </tr>
  </table>
</div>
 <input type="button" value="快速新增" onclick="AllAutoAdd(8)">&nbsp;&nbsp;
<input type="button" value="全部開放" onclick="AllOpenClose(0, 8)">&nbsp;&nbsp;
<input type="button" value="全部關閉" onclick="AllOpenClose(1, 8)">&nbsp;&nbsp;
<br />
<hr /><br />

<div>上海時時彩</div>
<div class="ctabdv">
  <table width="1000" border="0" cellspacing="1" cellpadding="0" class="ctab" id="LID6Cont">
    <tr class="ctiga"> 
      <td width="100">網站</td>
      <td width="80">一般期數</td>
      <td width="80">官方期數</td>
	  <td width="120">日期時間</td>
	  <td width="80">停押時間</td>
      <td width="80">狀態</td>
	  <td width="200">遊戲開關數</td>
      <td>開關</td>
    </tr>
  </table>
</div>
 <input type="button" value="快速新增" onclick="AllAutoAdd(6)">&nbsp;&nbsp;
<input type="button" value="全部開放" onclick="AllOpenClose(0, 6)">&nbsp;&nbsp;
<input type="button" value="全部關閉" onclick="AllOpenClose(1, 6)">&nbsp;&nbsp;
<br />
<hr /><br />

<div>廣西時時彩</div>
<div class="ctabdv">
  <table width="1000" border="0" cellspacing="1" cellpadding="0" class="ctab" id="LID5Cont">
    <tr class="ctiga"> 
      <td width="100">網站</td>
      <td width="80">一般期數</td>
      <td width="80">官方期數</td>
	  <td width="120">日期時間</td>
	  <td width="80">停押時間</td>
      <td width="80">狀態</td>
	  <td width="200">遊戲開關數</td>
      <td>開關</td>
    </tr>
  </table>
</div>
<input type="button" value="快速新增" onclick="AllAutoAdd(5)">&nbsp;&nbsp;
<input type="button" value="全部開放" onclick="AllOpenClose(0, 5)">&nbsp;&nbsp;
<input type="button" value="全部關閉" onclick="AllOpenClose(1, 5)">&nbsp;&nbsp;

<br /><br />
<iframe src="" width="300" height="300" name="getData"></iframe>
<form action="index.php" target="getData" name="getDataForm">
<input type="hidden" name="op" value="OpenOff">
<input type="hidden" name="LottoID" value="0">
<input type="hidden" name="Bet_Type" value="-1">
<input type="hidden" name="isStopBet" value="1">
<input type="hidden" name="WebGID" value="">
</form>
</body>
</html>
